﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SeriesManager.Model;

namespace SeriesManager.Test.Model
{
    [TestClass]
    public class SeriesTests
    {
        #region Constructor tests

        [TestMethod]
        public void ConstructorTestSuccessfull()
        {
            Series target = new Series();

            string name = "Bones";

            target.Name = name;

            Assert.AreEqual(name, target.Name);
            Assert.IsNotNull(target.Seasons);
        }

        #endregion

        #region AddSeason test

        [TestMethod]
        public void AddSeasonTestSuccessfull()
        {
            Series target = new Series();
            Season toAdd = new Season(target, 1);

            target.AddSeason(toAdd);

            Assert.IsNotNull(target.Seasons);
            Assert.AreEqual(1, target.Seasons.Count);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void AddSeasonTestFailedNoSeason()
        {
            Series target = new Series();

            target.AddSeason(null);
        }

        #endregion
    }
}
